home *** CD-ROM | disk | FTP | other *** search
/ Champak 142 / Volume 142 Oct 17 2011 - Damaged.iso / Games / parasite-x.swf / scripts / frame_8 / PlaceObject3_27_7 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Text File  |  2011-10-17  |  628b  |  34 lines

  1. onClipEvent(enterFrame){
  2.    if(Key.isDown(32))
  3.    {
  4.       _root.gamepaused = 1;
  5.    }
  6.    else
  7.    {
  8.       _root.gamepaused = 0;
  9.    }
  10.    if(this.hitTest(_root.wall))
  11.    {
  12.       this._x = -90;
  13.    }
  14.    if(this.hitTest(_root.wall2))
  15.    {
  16.       this._x = 620;
  17.    }
  18.    if(this.hitTest(_root.wall3))
  19.    {
  20.       this._y = -50;
  21.    }
  22.    if(this.hitTest(_root.wall4))
  23.    {
  24.       this._y = 950;
  25.    }
  26.    if(!this.hitTest(_root.land))
  27.    {
  28.    }
  29.    dist_x = this._x - _root._xmouse;
  30.    dist_y = this._y - _root._ymouse;
  31.    angle = - Math.atan2(dist_x,dist_y);
  32.    this._rotation = angle / 0.017453292519943295;
  33. }
  34.